#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
int main()
{
   int x,y;
   while(scanf("%d %d",&x,&y)!=EOF)
  {
    if(x%y==0)
	printf("1\n");
	else
	printf("0\n");
  }
   return 0;      
}